package utils.json.data;

import java.util.ArrayList;
import java.util.List;

import models.Focus;
import models.User;
import utils.json.AbstractJSON;

public class FocusJSON extends AbstractJSON {
	public FocusJSON(Focus focus) {
		put("id", focus.id);
        put("title", focus.title);
        put("description", focus.description);
         
        User owner = focus.getOwner();
        put("owner", new UserJSON(owner));
        
        List<User> participants = focus.getParticipants();
        List<UserJSON> participantsJSON = new ArrayList<UserJSON>();
        for(User participant : participants) participantsJSON.add(new UserJSON(participant));
        put("participants", participantsJSON);
        //put("countInfoRequest", focus.informationRequest.count());
 }
}
